var Page = function(){
    this.init();
};
Page.prototype = {
    params: {
        passport: '',
        withdrawId:''
    },
    init: function(){
        this.initParams();
        this.initEvent();
    },
    initParams: function(){
        this.params.passport = Pub.getCookie('_PASSPORT');
        this.params.withdrawId = Pub.getSession('withdrawId');
    },
    getData: function(){
        var _this = this;
        var paramsObj = {
            passport: _this.params.passport,
            withdrawId: _this.params.withdrawId
        };
        Api.withdrawaldetails(paramsObj, function(data){
            console.log(data);
            $('#orderNumber').text(data.withdrawNumber);
            $('#money').text(data.money);
            $('#bankAddress').text(data.bankName);
            $('#remark').text(data.remark);
            $('#realName').text(data.realName);
            $('#bankCardNumber').text(data.bankNumber);
            $('#gmtCreate').text(data.gmtCreate);
            $('#gmtAccount').text(data.gmtModified);
            $('#reply').text(data.reply);
            $('#purposeExplain').text(data.purposeExplain);

            if (data.state==0) {
                $('#state').text('审核中');
            }
            else if (data.state==1) {
                $('#state').text('借款中');
            }else if(data.state==2){
                $('#state').text('借款成功');
            }else if(data.state==3){
                $('#state').text('借款失败');
            }else if(data.state==4){
                $('#state').text('拒绝');
            };
        });
    },
    otherEvent:function(){
        var _this = this;
        $('.goods-checkbox input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        })
    },
    initEvent: function(){
        var _this = this;
         _this.getData();
        _this.otherEvent();


    }
};
var page = new Page();